{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "283174f8",
   "metadata": {},
   "source": [
    "# BatchFixedLagSmoother\n",
    "\n",
    "## Overview\n",
    "\n",
    "The `IncrementalFixedLagSmoother` is a [FixedLagSmoother](FixedLagSmoother.ipynb) that uses [LevenbergMarquardtOptimizer](LevenbergMarquardtOptimizer.ipynb) for batch optimization.\n",
    "\n",
    "This fixed lag smoother will **batch-optimize** at every iteration, but warm-started from the last estimate."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "92b4f851",
   "metadata": {},
   "source": [
    "## API\n",
    "\n",
    "### Constructor\n",
    "\n",
    "You construct a `BatchFixedLagSmoother` object with the following parameters:\n",
    "\n",
    "- **smootherLag**: The length of the smoother lag. Any variable older than this amount will be marginalized out. *(Default: 0.0)*\n",
    "- **parameters**: The Levenberg-Marquardt optimization parameters. *(Default: `LevenbergMarquardtParams()`)*  \n",
    "- **enforceConsistency**: A flag indicating whether the optimizer should enforce probabilistic consistency by maintaining the linearization point of all variables involved in linearized/marginal factors at the edge of the smoothing window. *(Default: `true`)*\n",
    "\n",
    "### Smoothing and Optimization\n",
    "\n",
    "- **update**: This method is the core of the `BatchFixedLagSmoother`. It processes new factors and variables, updating the current estimate of the state. The update method also manages the marginalization of variables that fall outside the fixed lag window.\n",
    "\n",
    "### Computational Considerations\n",
    "\n",
    "Every call to `update` triggers a batch LM optimization: use the parameters to control the convergence thresholds to bound computation to fit within your application."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4a2bdd3e",
   "metadata": {},
   "source": [
    "## Internals\n",
    "\n",
    "- **marginalize**: This function handles the marginalization of variables that are no longer within the fixed lag window. Marginalization is a crucial step in maintaining the size of the factor graph, ensuring that only relevant variables are kept for optimization.\n"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
